
import Layout from '@/layout'

const purchaseRouter = {
  path: '/purchase',
  type: 'top',
  component: Layout,
  redirect: 'noRedirect',
  name: 'Purchase',
  meta: {
    title: 'Purchase',
    icon: 'tree'
  },
  children: [
    {
      path: '/purchase/order',
      component: { // 这时路由页面正常显示, 但这时会嵌套一层router-view; 如果把component注释掉, 页面就空了
        render: h => h('router-view')
      },
      name: 'order',
      meta: { title: 'purchase.Order', noCache: true, icon: 'order' },
      children: [
        {
          path: 'chicken',
          component: () => import('@/views/purchase/order/chicken'),
          name: 'Chicken',
          meta: { title: 'purchase.order.chicken', noCache: true }
        },
        {
          path: 'drug',
          component: () => import('@/views/purchase/order/drug'),
          name: 'Drug',
          meta: { title: 'purchase.order.drug', noCache: true }
        },
        {
          path: 'feed',
          component: () => import('@/views/purchase/order/feed'),
          name: 'Feed',
          meta: { title: 'purchase.order.feed', noCache: true }
        },
        {
          path: 'package',
          component: () => import('@/views/purchase/order/package'),
          name: 'Package',
          meta: { title: 'purchase.order.package', noCache: true }
        },
        {
          path: 'other',
          component: () => import('@/views/purchase/order/other'),
          name: 'Other',
          meta: { title: 'purchase.order.other', noCache: true }
        }
      ]
    },
    {
      path: '/purchase/arrival',
      component: { // 这时路由页面正常显示, 但这时会嵌套一层router-view; 如果把component注释掉, 页面就空了
        render: h => h('router-view')
      },
      name: 'arrival',
      meta: { title: 'purchase.Arrival', noCache: true, icon: 'arrival' },
      children: [
        {
          path: 'chicken',
          component: () => import('@/views/purchase/arrival/chicken'),
          name: 'Chicken',
          meta: { title: 'purchase.arrival.chicken', noCache: true }
        },
        {
          path: 'drug',
          component: () => import('@/views/purchase/arrival/drug'),
          name: 'Drug',
          meta: { title: 'purchase.arrival.drug', noCache: true }
        },
        {
          path: 'feed',
          component: () => import('@/views/purchase/arrival/feed'),
          name: 'Feed',
          meta: { title: 'purchase.arrival.feed', noCache: true }
        },
        {
          path: 'package',
          component: () => import('@/views/purchase/arrival/package'),
          name: 'Package',
          meta: { title: 'purchase.arrival.package', noCache: true }
        },
        {
          path: 'other',
          component: () => import('@/views/purchase/arrival/other'),
          name: 'Other',
          meta: { title: 'purchase.arrival.other', noCache: true }
        }
      ]
    },
    {
      path: '/purchase/return',
      component: { // 这时路由页面正常显示, 但这时会嵌套一层router-view; 如果把component注释掉, 页面就空了
        render: h => h('router-view')
      },
      name: 'return',
      meta: { title: 'purchase.Return', noCache: true, icon: 'return' },
      children: [
        {
          path: 'chicken',
          component: () => import('@/views/purchase/return/chicken'),
          name: 'Chicken',
          meta: { title: 'purchase.return.chicken', noCache: true }
        },
        {
          path: 'drug',
          component: () => import('@/views/purchase/return/drug'),
          name: 'Drug',
          meta: { title: 'purchase.return.drug', noCache: true }
        },
        {
          path: 'feed',
          component: () => import('@/views/purchase/return/feed'),
          name: 'Feed',
          meta: { title: 'purchase.return.feed', noCache: true }
        },
        {
          path: 'package',
          component: () => import('@/views/purchase/return/package'),
          name: 'Package',
          meta: { title: 'purchase.return.package', noCache: true }
        },
        {
          path: 'other',
          component: () => import('@/views/purchase/return/other'),
          name: 'Other',
          meta: { title: 'purchase.return.other', noCache: true }
        }
      ]
    }
  ]
}

export default purchaseRouter
